<template>
	<view>
		<view class="content">
			<view class="div_as" @click="openThe(item.id)" v-for="(item,index) in buildList" :key="index">
				<image :src="item.thumb" mode="widthFix"></image>
				<view class="title">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				buildList: []
			}
		},
		onLoad() {
			uni.request({
				url: 'https://baiyi.kent.work/api/v1/system/getConstructionList',
				method: 'POST',
				data: {
					page: 1,
					limit: 10
				},
				success: res => {
					console.log(res);
					this.buildList = res.data.data.list
				}
			})
		},
		methods: {
			openThe() {
				uni.navigateTo({
					url: '/pages/construction/construction?id=${id}'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		box-sizing: content-box;
	}

	.div_as {
		margin: 0 40rpx;
		border-radius: 12rpx;
		box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.1);
		margin-top: 40rpx;

		.title {
			text-align: center;
			padding: 20rpx 0;
			font-size: 24rpx;
		}
		.div_as:last-child{
			margin-bottom: 40rpx;
		}
	}
</style>